#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    //Get current resolution-ratio && Set Mainwindow-widget size
    QScreen *screen = QGuiApplication::primaryScreen();
    const QRect screenGeometry = screen->geometry();
    this->resize(screenGeometry.size());

    //Set origin color red
    changeColor("red");

    //Creating a timer triggerd
    QTimer *timer = new QTimer(this);
    connect(timer, &QTimer::timeout, this, &MainWindow::nextColor);
    timer->start(3000);
}

MainWindow::~MainWindow()
{
    delete ui;
}

